package com.pubinfo.passbook.common.model.http.User;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Data
public class EInvoice implements Serializable {
  private static final long serialVersionUID = -8028611393759468313L;
  private String username;
  private String usercode;
  private String enterId;
  // @JSONField(name = "eInvoiceList")
  private List<EInvoiceId> eInvoiceList;
  
  public List<String> toList() {
    //List<EInvoiceId> eInvoiceList = Arrays.asList(this.eInvoiceList);
    List<EInvoiceId> eInvoiceList = this.eInvoiceList;
    List<String> strList = eInvoiceList.stream().map(EInvoiceId::getEInvoiceId).collect(Collectors.toList());
    return strList;
  }
}

